<?php

if (!isset($_GET['ok'])) {
        exit('Error');
}
@header("Content-Type:text/html;charset=utf-8");
$startime = time();
set_time_limit(0);
include_once dirname(dirname(dirname(__FILE__))) . '/nn_logic/nl_common.func.php';
include_once "nncms_controls_pinyin_class.php";
$dc = nl_get_dc(array(
    'db_policy' => NL_DB_WRITE,
    'cache_policy' => NP_KV_CACHE_TYPE_MEMCACHE
        )
);
$cout = 0;
//连接数据库
$dc->open();
$db = $dc->db();
$vodsql = "SELECT *
FROM `nns_weather_address`";
$vod = nl_query_by_db($vodsql, $db); //点播视频
if (!is_array($vod))
        $vod = array();
foreach ($vod as $v) {
        $py = @nns_controls_pinyin_class::get_pinyin_letter($v['nns_name']);
        $py = strtoupper($py);
        $vodupsql = "UPDATE  `nns_weather_address` SET  `nns_name_pinyin_pre`=  '$py'  WHERE  `nns_id` =  '{$v['nns_id']}' AND `nns_pid`=  '{$v['nns_pid']}'";
        nl_execute_by_db($vodupsql, $db);
}
?>